package com.qdsg.modulesihealsdk.utils;

import android.content.Context;
import android.os.Environment;

/**
 * @Description
 * @Author WuJianFeng
 * @Date 2022/11/21 9:53
 */
public class SihealSdkConstant {

    public static Context SihealSdkAppContext;

    /**
     * channelID：串口通道id，每个检测项都有指定的串口通道id，固定不变
     *  0: 血红蛋白测量
     *  1: 血脂测量
     *  2: 体脂
     *  3: 身高体重
     * 11: 血氧测量
     * 12: 血尿酸测量
     * 13: 体温测量
     * 15: 血压测量
     * 100: 血糖
     * -99：无效id
     */
    public static final byte channelID_HB = 0;
    public static final byte channelID_bloodFat = 1;
    public static final byte channelID_BF = 2;
    public static final byte channelID_HWBMI = 3;
    public static final byte channelID_SPO2 = 11;
    public static final byte channelID_UA = 12;
    public static final byte channelID_T = 13;
    public static final byte channelID_BP = 15;
    public static final byte channelID_glu = 100;
    public static final byte channelID_invalid = -99;

    /**
     * 身份证、社保卡读取：无卡
     */
    public static String CARD_NULL = "无卡";

    /**
     * 社保卡识别不到民族
     */
    public static String GROUP_ERROR = "卡片应答错误";


/**
 * 血糖测试流程状态
 * 1: 长按开机键
 * 2: 设备准备中
 * 3: 将手指放入指夹
 * 4: 检测过程中页面
 * 5: 等待结果上传
 */
public static int GLU_STATE_1 = 1;
public static int GLU_STATE_2 = 2;
public static int GLU_STATE_3 = 3;
public static int GLU_STATE_4 = 4;
public static int GLU_STATE_5 = 5;

public static String DE_ERR = "读卡器连接错";
public static String SPO2_P_ERR = "测量失败，建议重测";

/**
 * 血氧脉率类型
 * 1：血氧
 * 2：脉率
 */
public static final int SPO2_P_TYPE_1 = 1;
public static final int SPO2_P_TYPE_2 = 2;

/**
 * 检测项消息类型
 * 11: 血压
 */
public static final int MSG_BP = 11;






/**
 * 单导心电
 */


    /**
     * 蓝牙关闭广播
     */
    public static final String ACTION_BLUETOOH_OFF = "bluetooth_off";

    /**
     * 蓝牙打开广播
     */
    public static final String ACTION_BLUETOOH_ON = "bluetooth_on";

    /**
     * 存储设备被卸载
     */
    public static final String ACTION_MEDIA_EJECT = "media_eject";

    /**
     * 蓝牙连接断开
     */
    public static final String ACTION_BLU_DISCONNECT = "disconnect";

    /**
     * 存储设备已挂载
     */
    public static final String ACTION_MEDIA_MOUNTED = "media_mounted";

    /**
     * 蓝牙连接状态改变
     */
    public static final String BLU_ACTION_STATE_CHANGE = "state_change";

    /**
     * 蓝牙广播 开始连接设备
     */
    public static final String BLU_ACTION_STARTDISCOVERY = "startDiscovery";

    /**
     * 蓝牙广播 停止连接设备
     */
    public static final String BLU_ACTION_STOPDISCOVERY = "stopDiscovery";

    /**
     * 蓝牙广播 断开与设备的连接
     */
    public static final String BLU_ACTION_DISCONNECT = "disconnect";

    /**
     * 用户广播————当前用户退出登录
     */
    public static final String ACTION_USER_EXIT = "userexit";


    /**
     *  数据类型key——心电文件
     */
    public static final String DATATYPEKEY_ECG_FILE = "ecgFile";
    /**
     * 数据类型key——心电波形
     */
    public static final String DATATYPEKEY_ECG_WAVE = "ecgwave";

    /**
     * 设备数据消息——设备ID
     */
    public static final int MSG_DATA_DEVICE_ID = 0x201;

    /**
     *  设备数据消息——设备版本信息
     *  device version
     */
    public static final int MSG_DATA_DEVICE_VS = 0x202;

    /**
     *  设备数据消息——心电波形数据
     *  ECG WAVE
     */
    public static final int MSG_DATA_ECG_WAVE = 0x20d;

    /**
     *  设备数据消息——电池电量
     *  Battery Power
     */
    public static final int MSG_DATA_BATTERY = 0x20e;
    /**
     * 设备数据消息——心电测量状态改变
     * ecg measure status change
     */
    public static final int MSG_DATA_ECG_STATUS_CH = 0x209;

    /**
     * 设备数据消息——搏动标记
     * pulse flag
     */
    public static final int MSG_DATA_PULSE = 0x20f;

    /**
     * 超时
     * time out
     */
    public static final int MSG_DATA_TIMEOUT = 0x210;

    /**
     * 终端离线
     * termimal offline
     */
    public static final int MSG_TERMINAL_OFFLINE = 0x212;


    /**
     * 正在打开蓝牙
     */
    public static final int BLUETOOTH_MSG_OPENING = 0;

    /**
     * 搜索设备
     */
    public static final int BLUETOOTH_MSG_DISCOVERYING = 1;

    /**
     * 正在连接设备
     */
    public static final int BLUETOOTH_MSG_CONNECTING = 2;

    /**
     * 连接成功
     */
    public static final int BLUETOOTH_MSG_CONNECTED = 3;

    /**
     * 连接失败
     */
    public static final int BLUETOOTH_MSG_CONNECTFILE = 4;
    /**
     * 打开蓝牙失败
     */
    public static final int BLUETOOTH_MSG_OPENINGFILE = 5;
    /**
     * 搜索完成
     */
    public static final int BLUETOOTH_MSG_DISCOVERYED = 6;


    /**
     * 当前蓝牙状态——正常
     */
    public static final int BLU_STATUS_NORMAL = 0;

    /**
     * 当前蓝牙状态——搜索中
     */
    public static final int BLU_STATUS_DISCOVERING = 1;

    /**
     * 当前蓝牙状态——连接中
     */
    public static final int BLU_STATUS_CONNECTING = 2;

    /**
     * 当前蓝牙状态——连接上
     */
    public static final int BLU_STATUS_CONNECTED = 3;

    public static final String filePath = Environment.getExternalStorageDirectory()+"/PC80B";
    public static final String fileName = "1.ECG";


}
